package vehicles;

import java.util.ArrayList;
import java.util.List;

import passengers.Human;

public class Bus implements Vehicle<Human> {

	private int seatsAmount = 20;
	
	private List<Human> seats = new ArrayList<Human>();
	
	@Override
	public int getSeatsAmount() {
		return seatsAmount;
	}

	@Override
	public int getOccupaidSeatsAmount() {
		return seats.size();
	}

	@Override
	public void putPassenger(Human passenger) {
		if (getOccupaidSeatsAmount() >= getSeatsAmount()) throw new RuntimeException("no more seats");
		seats.add(passenger);
	}

	@Override
	public boolean getPassenger(Human passenger) {
		if (seats.remove(passenger)){
			return true;
		} else{
			throw new RuntimeException("no such passenger");
		}
	}

	

	
	
	
}
